package com.example.ipcdemo;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author by  zhengshaorui on
 * Describe:
 */
public class TaskInfo implements Parcelable {

    public int id;
    public String url;
    public int progress;


    public TaskInfo() {
    }

    protected TaskInfo(Parcel in) {
        id = in.readInt();
        url = in.readString();
        progress = in.readInt();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(url);
        dest.writeInt(progress);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<TaskInfo> CREATOR = new Creator<TaskInfo>() {
        @Override
        public TaskInfo createFromParcel(Parcel in) {
            return new TaskInfo(in);
        }

        @Override
        public TaskInfo[] newArray(int size) {
            return new TaskInfo[size];
        }
    };

    @Override
    public String toString() {
        return "TaskInfo{" +
                "id=" + id +
                ", url='" + url + '\'' +
                ", progress=" + progress +
                '}';
    }
}
